home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: Pointers to register
- Date: 22 Mar 1996 06:34:31 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4iu6on$nt5@solutions.solon.com>
- References: <1239@altheim.win-uk.net> <4iklpm$28s@sparcserver.lrz-muenchen.de> <1247@altheim.win-uk.net>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <1247@altheim.win-uk.net>,
- Brian R. Oldham <broldham@altheim.win-uk.net> wrote:
- >Yes Kurt, I think I've got the message by now. But where you guys keep
- >missing the point (like Nottm Forest kept missing the Bayern Munich
- >goalposts :-{ ) is that if declaration:
-
- > *ptr = var;
-
- >is wrong for other objects in memory then why does it work for:
-
- > *ptr = union_member;
-
- It's not wrong for other objects in memory; it's merely not a declaration.
- *ptr = var; means "assuming that ptr already points correctly to something
- of the same type as var, copy from var into the area pointed at."
- So, *ptr = union_member should work.
-
- >And why does my compiler complain at the correct way:
-
- > ptr = &union_member;
-
- Because this does a much different thing.
- ptr = &var;
- means "cause ptr to point at this particular object". This is obviously
- invalid for a register object, which is not in memory. :)
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-